<div class="row">
    <div class="col-md-2">

    </div>
    <div class="col-md-8">

        <marquee onmouseover="this.stop()" onmouseout="this.start()" scrollamount="7">
            <h4><b>Chào mừng các bạn đến với cổng thông tin tình nguyện</b></h4>
        </marquee>

    </div>
</div>
<div class="row highlight">
    <div class="col-md-9">
        <div id="myCarousel" class="carousel slide" style="height: 350px">
            <ol class="carousel-indicators">
                <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                <li data-target="#myCarousel" data-slide-to="1"></li>
                <li data-target="#myCarousel" data-slide-to="2"></li>
            </ol>
            <!-- Carousel items -->
            <div class="carousel-inner" style="height: 350px">
                <div class="active item">
                    <img src="<?php echo base_url("public/images/tinhnguyen/12.jpg"); ?>" style="height: 350px;" alt="">

                    <div class="carousel-caption" style="bottom: 25%;">
                        <h2>Hello</h2>
                    </div>
                </div>
                <div class="item">
                    <img src="<?php echo base_url("public/images/tinhnguyen/13.jpg"); ?>" style="height: 350px; "
                         alt="">
                </div>
                <div class="item">
                    <img src="<?php echo base_url("public/images/tinhnguyen/14.png"); ?>" style="height: 350px; "
                         alt="">
                </div>
            </div>
            <!-- Carousel nav -->
            <a class="carousel-control left" href="#myCarousel" data-slide="prev"><span
                    class="glyphicon glyphicon-chevron-left"></span></a>
            <a class="carousel-control right" href="#myCarousel" data-slide="next"><span
                    class="glyphicon glyphicon-chevron-right"></span></a>
        </div>
    </div>
    <!-- /.col-md-8 -->
    <div class="col-md-3 ">

        <h3>Cổng thông tin tìm kiếm trung tâm tình nguyện</h3>

        <p>Với mục tiêu đáp ứng nhu cầu tìm kiềm thông tin của các mái ấm nhà mở trên địa bàn thành phố Hồ Chí Minh.
            Website sẽ cũng cung cấp cho người dùng các
            tình năng tìm kiếm đơn giản, thao tác dễ dàng. Nhấn ngay nút bên dưới để bắt đầu tìm kiếm </p>
        <a class="btn btn-primary btn-lg" href="<?php echo base_url("index.php/website/map"); ?>">Bắt đầu tìm kiếm</a>
    </div>
    <!-- /.col-md-4 -->
</div>
<!-- /.row -->
<hr>
<!-- danh sach mai am -->
<div class="panel panel-success">
    <div class="panel-heading">
        <h3 class="panel-title text-left"><span><img src="<?php echo base_url("public/images/icon/house_blue.ico"); ?>"
                                                     class="icon-listnews"/></span><b>Địa điểm</b></h3>
    </div>
    <div class="panel-body bg-mycolor">
        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li class="active"><a href="#places" role="tab" data-toggle="tab">
                    <span><img src="<?php echo base_url("public/images/icon/places_1.ico"); ?>" class="icon-listnews"/></span>
                    <b>Địa điểm mới</b></a></li>
            <li><a href="#placess" role="tab" data-toggle="tab">
                    <span><img src="<?php echo base_url("public/images/icon/places_2.ico"); ?>" class="icon-listnews"/></span>
                    <b>Địa điểm xem nhiều</b></a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <div class="tab-pane active listnews" id="places">
                <?php $i = 0; ?>
                <?php foreach ($centers as $center): ?>
                    <div class="col-md-3">
                        <div class="thumbnail thumbnailsize">
                            <img src="<?php echo base_url($images_center[$i][0]['url_image']); ?>"
                                 class="img-thumbnail myshadow" style="height: 140px; width: 210px;">

                            <div class="caption text-left">
                                <a href="<?php echo base_url("index.php/website/center/loadByid/" . $center['id_center']); ?>"
                                   style="text-decoration: none;"><h4><span class="glyphicon glyphicon-home"></span>&nbsp;<?php echo $center['name']; ?>
                                    </h4></a>

                                <p>
                                    <span
                                        class="glyphicon glyphicon-eye-open"><?php echo $center['view']; ?></span><br/>
                                    <span class="glyphicon glyphicon-map-marker"></span>&nbsp
                                    <?php
                                    $str = $center['discription'];
                                    if (strlen($str) > 110) {
                                        $str = substr($str, 0, 110);
                                        $str = substr($str, 0, strrpos($str, ' '));
                                    }
                                    echo $str . ' ...';
                                    ?>
                                    <a href="<?php echo base_url("index.php/website/center/loadByid/" . $center['id_center']); ?>"
                                       class="btn btn-info btn-xs" role="button">Xem thêm</a>
                                </p>
                            </div>
                        </div>
                    </div>
                    <?php $i = $i + 1; ?>
                <?php endforeach; ?>
                <div class="text-right" style="margin-right: 2%;">
                    <a href="<?php echo base_url("index.php/website/center"); ?>">Xem nhiều hơn</a>
                </div>
            </div>
            <div class="tab-pane listnews" id="placess">
                <?php $i = 0; ?>
                <?php foreach ($most_view_center as $center): ?>
                    <div class="col-md-3">
                        <div class="thumbnail thumbnailsize">
                            <img src="<?php echo base_url($images_view_center[$i][0]['url_image']); ?>"
                                 class="img-thumbnail myshadow " style="height: 140px; width: 210px;">

                            <div class="caption text-left">
                                <a href="<?php echo base_url("index.php/website/center/loadByid/" . $center['id_center']); ?>">
                                    <h4>
                                        <span class="glyphicon glyphicon-home"></span>&nbsp;
                                        <?php echo $center['name']; ?>
                                    </h4></a>
                                <span class="glyphicon glyphicon-eye-open"><?php echo $center['view']; ?></span>

                                <p>
                                    <?php
                                    $str = $center['discription'];
                                    if (strlen($str) > 110) {
                                        $str = substr($str, 0, 110);
                                        $str = substr($str, 0, strrpos($str, ' '));
                                    }
                                    echo $str . '...';
                                    ?>
                                    <a href="<?php echo base_url("index.php/website/center/loadByid/" . $center['id_center']); ?>"
                                       class="btn btn-info btn-xs" role="button">Xem thêm</a>
                                </p>
                            </div>
                        </div>
                    </div>
                    <?php $i = $i + 1; ?>
                <?php endforeach; ?>
                <div class="text-right" style="margin-right: 2%;">
                    <a href="<?php echo base_url("index.php/website/center"); ?>">Xem nhiều hơn</a>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- tin tức -->
<div class="panel panel-success">
    <div class="panel-heading">
        <h3 class="panel-title text-left"><span><img src="<?php echo base_url("public/images/icon/news.ico"); ?>"
                                                     class="icon-listnews"/></span>Tin tức</h3>
    </div>
    <div class="panel-body bg-mycolor">
        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li class="active"><a href="#news" role="tab" data-toggle="tab">
                    <span><img src="<?php echo base_url("public/images/icon/lasted-news.ico"); ?>"
                               class="icon-listnews"/></span>
                    Tin tức mới</a></li>
            <li><a href="#news" role="tab" data-toggle="tab">
                    <span><img src="<?php echo base_url("public/images/icon/news_2.ico"); ?>"
                               class="icon-listnews"/></span>
                    Tin tức xem nhiều</a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <!--            Tin moi nhat-->
            <div class="tab-pane active listnews" id="news">
                <?php $i = 0 ?>
                <?php foreach ($articles as $article): ?>
                    <div class="col-md-3">
                        <div class="thumbnail thumbnailsize">
                            <img src="<?php echo base_url($images_article[$i][0]['url_image_article']); ?>"
                                 class="img-thumbnail myshadow" style="height: 140px; width: 210px;">

                            <div class="caption text-left">
                                <a href="<?php echo base_url("index.php/website/article/id/" . $article['id_article']); ?>"
                                   style="text-decoration: none;">
                                    <h4><span
                                            class="glyphicon glyphicon-globe"></span>&nbsp;<?php echo $article['title']; ?>
                                    </h4></a>
                                <span class="glyphicon glyphicon-eye-open"><?php echo $article['view']; ?></span>

                                <p>
                                    <?php
                                    if (strlen($article['source']) > 120) {
                                        $article['source'] = substr($article['source'], 0, 120);
                                        $article['source'] = substr($article['source'], 0, strrpos($article['source'], ' '));
                                    }
                                    echo $article['source'] . ' ...';
                                    ?>
                                    <a href="<?php echo base_url("index.php/website/article/id/" . $article['id_article']); ?>"
                                       class="btn btn-info btn-xs" role="button">Xem thêm</a>
                                       <?php
                                       ?>
                                </p>
                            </div>
                        </div>
                    </div>
                    <?php $i = $i + 1; ?>
                <?php endforeach; ?>
                <div class="text-right" style="margin-right: 2%;">
                    <a href="<?php echo base_url("index.php/website/article"); ?>">Xem nhiều hơn</a>
                </div>
            </div>
            <!--            Tin tức được xem nhiều nhất-->
            <div class="tab-pane listnews" id="newss">
                <?php $i = 0 ?>
                <?php foreach ($most_view_articles as $article): ?>
                    <div class="col-md-3">
                        <div class="thumbnail thumbnailsize">
                            <img src="<?php echo base_url($images_view_article[$i][0]['url_image_article']); ?>"
                                 class="img-thumbnail myshadow" style="height: 140px; width: 210px;">

                            <div class="caption text-left">
                                <a href="<?php echo base_url("index.php/website/article/id/" . $article['id_article']); ?>"
                                   style="text-decoration: none;">
                                    <h4><span
                                            class="glyphicon glyphicon-globe"></span>&nbsp;<?php echo $article['title']; ?>
                                    </h4></a>
                                <span class="glyphicon glyphicon-eye-open"><?php echo $article['view']; ?></span>

                                <p>
                                    <?php
                                    if (strlen($article['source']) > 120) {
                                        $article['source'] = substr($article['source'], 0, 120);
                                        $article['source'] = substr($article['source'], 0, strrpos($article['source'], ' '));
                                    }
                                    echo $article['source'] . ' ...';
                                    ?>
                                    <a href="<?php echo base_url("index.php/website/article/id/" . $article['id_article']); ?>"
                                       class="btn btn-info btn-xs" role="button">Xem thêm</a>
                                       <?php
                                       ?>
                                </p>
                            </div>
                        </div>
                    </div>
                    <?php $i = $i + 1; ?>
                <?php endforeach; ?>
                <div class="text-right" style="margin-right: 2%;">
                    <a href="<?php echo base_url("index.php/website/article"); ?>">Xem nhiều hơn</a>
                </div>
            </div>
        </div>

    </div>
</div>

<!-- Hoạt động -->
<div class="panel panel-success">
    <div class="panel-heading">
        <h3 class="panel-title text-left"><span><img
                    src="<?php echo base_url("public/images/icon/community_help.ico"); ?>"
                    style="height: 50px; width: 50px;"/></span>Hoạt động nổi bật</h3>
    </div>
    <div class="panel-body bg-mycolor">

        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li class="active"><a href="#activity" role="tab" data-toggle="tab">
                    <span><img src="<?php echo base_url("public/images/icon/activity_1.ico"); ?>"
                               class="icon-listnews"/></span>
                    Hoạt động mới</a></li>
            <li><a href="#topact" role="tab" data-toggle="tab">
                    <span><img src="<?php echo base_url("public/images/icon/activity_1.ico"); ?>"
                               class="icon-listnews"/></span>
                    Hoạt động đươc quan tâm</a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <div class="tab-pane active listnews" id="activity">
                <?php $i = 0 ?>
                <?php foreach ($activities as $activity): ?>
                    <div class="col-md-3">
                        <div class="thumbnail thumbnailsize">
                            <img src="<?php echo base_url("public/images/tinhnguyen/9.jpg"); ?>"
                                 class="img-thumbnail myshadow" style="height: 140px; width: 210px;">

                            <div class="caption text-left">
                                <a href="<?php echo base_url("index.php/website/activity/load_by_id/" . $activity['id_activity']); ?>"
                                   style="text-decoration: none;">
                                    <h4><span
                                            class="glyphicon glyphicon-globe"></span>&nbsp;<?php echo $activity['name']; ?>
                                    </h4></a>
                                <span class="glyphicon glyphicon-eye-open"><?php echo $activity['view']; ?></span>
                                Tại: &nbsp;<?php echo $activity['ct_name']; ?>
                                <p>Thời gian: &nbsp;<?= date('H:i d/m/Y', strtotime($activity['startday'])); ?></p>

                                <p>
                                    <?php
                                    if (strlen($activity['discription']) > 87) {
                                        $activity['discription'] = substr($activity['discription'], 0, 87);
                                        $activity['discription'] = substr($activity['discription'], 0, strrpos($activity['discription'], ' '));
                                    }
                                    echo $activity['discription'] . ' ...';
                                    ?>
                                    <a href="<?php echo base_url("index.php/website/activity/load_by_id/" . $activity['id_activity']); ?>"
                                       class="btn btn-info btn-xs" role="button">Xem thêm</a>
                                       <?php
                                       ?>
                                </p>
                            </div>
                        </div>
                    </div>
                    <?php $i = $i + 1; ?>
                <?php endforeach; ?>
            </div>
            <!--hoạt đông được xem nhiều nhất-->
            <div class="tab-pane listnews" id="topact">
                <?php $i = 0 ?>
                <?php foreach ($most_view_acts as $activity): ?>
                    <div class="col-md-3">
                        <div class="thumbnail thumbnailsize">
                            <img src="<?php echo base_url("public/images/tinhnguyen/10.jpg"); ?>"
                                 class="img-thumbnail myshadow" style="height: 140px; width: 210px;">

                            <div class="caption text-left">
                                <a href="<?php echo base_url("index.php/website/activity/load_by_id/" . $activity['id_activity']); ?>"
                                   style="text-decoration: none;">
                                    <h4><span
                                            class="glyphicon glyphicon-globe"></span>&nbsp;<?php echo $activity['name']; ?>
                                    </h4></a>
                                <span class="glyphicon glyphicon-eye-open"><?php echo $activity['view']; ?></span>&nbsp;
                                Tại: &nbsp;<?php echo $activity['ct_name']; ?>
                                <p>Thời gian: &nbsp;<?= date('H:i d/m/Y', strtotime($activity['startday'])); ?></p>

                                <p>
                                    <?php
                                    if (strlen($activity['discription']) > 87) {
                                        $activity['discription'] = substr($activity['discription'], 0, 87);
                                        $activity['discription'] = substr($activity['discription'], 0, strrpos($activity['discription'], ' '));
                                    }
                                    echo $activity['discription'] . ' ...';
                                    ?>
                                    <a href="<?php echo base_url("index.php/website/activity/load_by_id/" . $activity['id_activity']); ?>"
                                       class="btn btn-info btn-xs" role="button">Xem thêm</a>
                                       <?php
                                       ?>
                                </p>
                            </div>
                        </div>
                    </div>
                    <?php $i = $i + 1; ?>
                <?php endforeach; ?>

            </div>
            <div class="text-right" style="margin-right: 2%;">
                <a href="<?php echo base_url("index.php/website/activity"); ?>">Xem nhiều hơn</a>
            </div>
        </div>
    </div>
</div>

